From ea02974cb6d3a902a398226720e892caf30e02cf Mon Sep 17 00:00:00 2001 From: Philip Tzou Date: Wed, 16 Feb 2011 16:07:58 +0000 Subject: [PATCH] revert r77452, r80492 and r82246. --- includes/MessageCache.php | 34 +++++++++------------------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/includes/MessageCache.php b/includes/MessageCache.php index 69cffe45c6..d66e710c90 100644 --- a/includes/MessageCache.php +++ b/includes/MessageCache.php @@ -576,6 +576,15 @@ class MessageCache { return false; } + $lang = wfGetLangObj( $langcode ); + if ( !$lang ) { + throw new MWException( "Bad lang code $langcode given" ); + } + + $langcode = $lang->getCode(); + + $message = false; + # Normalise title-case input (with some inlining) $lckey = str_replace( ' ', '_', $key ); if ( ord( $key ) < 128 ) { @@ -586,31 +595,6 @@ class MessageCache { $uckey = $wgContLang->ucfirst( $lckey ); } - $lang = wfGetLangObj( $langcode ); - if ( !$lang ) { - throw new MWException( "Bad lang code $langcode given" ); - } - - /** - * Find a suitable sub-language to present the message to user, - * but prevent doing it if the message is for css/js. - * - * Some language like Chinese has multiple variant languages. Only - * getPreferredVariant() (in LanguageConverter) could return such - * sub-language. It won't effect other languages without variants. - */ - $title = Title::newFromText( $uckey, NS_MEDIAWIKI ); - if ( !$title->isCssOrJsPage() ) { - $langcode = $lang->getPreferredVariant(); - if ( $langcode != $lang->getCode() ) { - $lang = wfGetLangObj( $langcode ); - } - } else { - $langcode = $lang->getCode(); - } - - $message = false; - /** * Record each message request, but only once per request. * This information is not used unless $wgAdaptiveMessageCache -- 2.20.1